package com.iptv.grape;

import android.os.Build;
import android.widget.ListView;

import com.iptv.grape.ui.adpt.SystemAdpt;
import com.iptv.grape.util.AppLog;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class SystemAct extends BaseAct {

    @Override
    protected int layout() {
        return R.layout.act_system;
    }
    @Override
    protected void initView() {
        log();
        getDeviceInfo();
        SystemAdpt adpt = new SystemAdpt(SystemAct.this,initData());
//        ListView listView = findViewById(R.id.lvSystem);
//        listView.setAdapter(adpt);

    }

    private List<HashMap<String,String>> initData(){
        List<HashMap<String,String>>  list = new ArrayList<>();
        HashMap<String,String> map = new HashMap<>();
        map.put("key","型号");
        String   model= android.os.Build.MANUFACTURER;
        map.put("value",model);
        list.add(map);

        map = new HashMap<>();
        map.put("key","安卓版本");
        String   RELEASE= Build.VERSION.RELEASE;
        map.put("value",RELEASE);
        list.add(map);

        map = new HashMap<>();
        map.put("key","固件版本");
        String   BOOTLOADER= android.os.Build.BOOTLOADER;
        map.put("value",BOOTLOADER);
        list.add(map);

        map = new HashMap<>();
        map.put("key","开发版本");
//        String   BOOTLOADER= android.os.Build.BOOTLOADER;
        map.put("value",BOOTLOADER);
        list.add(map);

        map = new HashMap<>();
        map.put("key","IP地址");
//        String   BOOTLOADER= android.os.Build.BOOTLOADER;
        map.put("value",BOOTLOADER);
        list.add(map);

        map = new HashMap<>();
        map.put("key","MAC地址");
//        String   BOOTLOADER= android.os.Build.BOOTLOADER;
        map.put("value",BOOTLOADER);
        list.add(map);

        return  list;
    }
    private String getDeviceInfo() {
        StringBuffer sb = new StringBuffer();
        sb.append("主板： "+ Build.BOARD);
        sb.append(
                "\n系统启动程序版本号： "+ Build.BOOTLOADER);
        sb.append(
                "\n系统定制商： "+ Build.BRAND);
        sb.append(
                "\ncpu指令集： "+ Build.CPU_ABI);
        sb.append(
                "\ncpu指令集2 "+ Build.CPU_ABI2);
        sb.append(
                "\n设置参数： "+ Build.DEVICE);
        sb.append(
                "\n显示屏参数：" + Build.DISPLAY);
        sb.append("\n无线电固件版本：" + Build.getRadioVersion());
        sb.append("\n硬件识别码： "+ Build.FINGERPRINT);
        sb.append("\n硬件名称： "+ Build.HARDWARE);
        sb.append("\nHOST: "+ Build.HOST);
        sb.append("\nBuild.ID);"+ Build.ID);
        sb.append("\n硬件制造商： "+ Build.MANUFACTURER);
        sb.append("\n版本： "+ Build.MODEL);
        sb.append("\n硬件序列号： "+ Build.SERIAL);
        sb.append("\n手机制造商： "+ Build.PRODUCT);
        sb.append("\n  描述Build的标签： "+ Build.TAGS);
        sb.append("\nTIME: "+ Build.TIME);
        sb.append("\nbuilder类型"+Build.TYPE);
        sb.append("\nUSER: "+Build.USER);
        AppLog.getCurLog().e("data22222 ===>>>>"+sb.toString());
        return sb.toString();
    }



    private  void log() {
        AppLog.getCurLog().e("data ===>>>>");
        StringBuilder stringBuilder = new StringBuilder();
        //BOARD 主板
        stringBuilder.append("BOARD: ") .append( android.os.Build.BOARD).append("\n");
        stringBuilder.append(", BOOTLOADER: ") .append( android.os.Build.BOOTLOADER).append("\n");
//BRAND 运营商
        stringBuilder.append(", BRAND: ") .append( android.os.Build.BRAND).append("\n");
        stringBuilder.append(", CPU_ABI: ") .append( android.os.Build.CPU_ABI).append("\n");
        stringBuilder.append(", CPU_ABI2: ") .append( android.os.Build.CPU_ABI2).append("\n");

//DEVICE 驱动
        stringBuilder.append(", DEVICE: ") .append( android.os.Build.DEVICE).append("\n");
//DISPLAY Rom的名字 例如 Flyme 1.1.2（魅族rom） &nbsp;JWR66V（Android nexus系列原生4.3rom）
         stringBuilder.append(", DISPLAY: ") .append( android.os.Build.DISPLAY).append("\n");
//指纹
         stringBuilder.append(", FINGERPRINT: ") .append( android.os.Build.FINGERPRINT).append("\n");
//HARDWARE 硬件
         stringBuilder.append(", HARDWARE: ") .append( android.os.Build.HARDWARE).append("\n");
         stringBuilder.append(", HOST: ") .append( android.os.Build.HOST).append("\n");
         stringBuilder.append(", ID: ") .append( android.os.Build.ID).append("\n");
//MANUFACTURER 生产厂家
         stringBuilder.append(", MANUFACTURER: ") .append( android.os.Build.MANUFACTURER).append("\n");
//MODEL 机型
         stringBuilder.append(", MODEL: ") .append( android.os.Build.MODEL).append("\n");
         stringBuilder.append(", PRODUCT: ") .append( android.os.Build.PRODUCT).append("\n");
         stringBuilder.append(", RADIO: ") .append( android.os.Build.RADIO).append("\n");
         stringBuilder.append(", RADITAGSO: ") .append( android.os.Build.TAGS).append("\n");
         stringBuilder.append(", TIME: ") .append( android.os.Build.TIME).append("\n");
         stringBuilder.append(", TYPE: ") .append( android.os.Build.TYPE).append("\n");
         stringBuilder.append(", USER: ") .append( android.os.Build.USER).append("\n");
//VERSION.RELEASE 固件版本
         stringBuilder.append(", VERSION.RELEASE: ") .append( android.os.Build.VERSION.RELEASE).append("\n");
         stringBuilder.append(", VERSION.CODENAME: ") .append( android.os.Build.VERSION.CODENAME).append("\n");
//VERSION.INCREMENTAL 基带版本
         stringBuilder.append(", VERSION.INCREMENTAL: ") .append( android.os.Build.VERSION.INCREMENTAL).append("\n");
//VERSION.SDK SDK版本
         stringBuilder.append(", VERSION.SDK: ") .append( android.os.Build.VERSION.SDK).append("\n");
         stringBuilder.append(", VERSION.SDK_INT: ") .append( android.os.Build.VERSION.SDK_INT).append("\n");
        AppLog.getCurLog().e("data ===>>>>"+stringBuilder.toString());
    }

}
